import type { RouteRecordRaw } from 'vue-router';

const routes: RouteRecordRaw[] = [
  {
    meta: {
      icon: 'lucide:home',
      order: -1,
      title: '主页',
    },
    name: 'Home',
    path: '/home',
    component: () => import('#/views/home/index.vue'),
  },
  {
    meta: {
      icon: 'lucide:file-text',
      order: 1,
      title: '记账凭证',
    },
    name: 'AccountingVoucher',
    path: '/accounting-voucher',
    children: [
      {
        name: 'AccountingVoucherEntry',
        path: '/entry',
        component: () => import('#/views/accounting-voucher/entry/index.vue'),
        meta: {
          title: '新增凭证',
        },
      },
      {
        name: 'AccountingVoucherView',
        path: '/view',
        component: () => import('#/views/accounting-voucher/view/index.vue'),
        meta: {
          title: '查看凭证',
        },
      },
      {
        name: 'AccountingVoucherList',
        path: '/list',
        component: () => import('#/views/accounting-voucher/list/index.vue'),
        meta: {
          title: '凭证列表',
        },
      },
    ],
  },
  {
    meta: {
      icon: 'lucide:book',
      order: 2,
      title: '账簿',
    },
    name: 'Ledger',
    path: '/ledger',
    children: [
      {
        name: 'LedgerGeneral',
        path: '/general',
        component: () => import('#/views/ledger/general/index.vue'),
        meta: {
          title: '总账',
        },
      },
      {
        name: 'LedgerDetail',
        path: '/detail',
        component: () => import('#/views/ledger/detail/index.vue'),
        meta: {
          title: '明细账',
        },
      },
    ],
  },
];

export default routes;
